:root {
    --theme: #000;
    --theme-transparent: #000d;
    --theme2: #222;
    --text-colour: #fff;
    --mouse-x: 0;
    --mouse-y: 0;
    font-family: Segoe UI;
    color: var(--text-colour);
}

#windows {
    position: fixed;
}

.window {
    --x: 0px;
    --y: 0px;
    --drag-border: 15px;
    --min-width: 400px;
    --min-height: 250px;
    --width: var(--min-width);
    --height: var(--min-height);
    --bounds-left: 0;
    --bounds-right: 0;
    --bounds-top: 0;
    --bounds-bottom: 0;
    --controls-height: 30px;
    width: var(--width);
    height: var(--height);
    min-width: var(--min-width);
    min-height: 250px;
    display: block;
    position: fixed;
    top: calc(0px - var(--drag-border));
    left: calc(0px - var(--drag-border));
    translate: clamp(0px, var(--x), calc(100vw - var(--width))) clamp(0px, var(--y), calc(100vh - var(--height)));
    border: var(--drag-border) solid transparent;
}

.window.active {
    z-index: 1;
}

.window.closing {
    animation-name: window-close;
    animation-duration: 0.1s;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes window-close {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

.controls {
    position: absolute;
    top: 1px;
    width: 100%;
    height: var(--controls-height);
    display: flex;
    flex-direction: row;
    justify-content: end;
    background-color: var(--theme);
}

.controls>.icon {
    user-select: none;
    pointer-events: none;
    position: absolute;
    left: 5px;
    height: 1em;
    top: 50%;
    translate: 0 -50%;
}

.controls>.title {
    user-select: none;
    pointer-events: none;
    position: absolute;
    left: 0;
    margin-left: 30px;
    line-height: var(--controls-height);
    font-size: 12px;
    color: var(--text-colour);
}

.controls>.window-button>* {
    vertical-align: middle;
    transform: scale(0.35);
    height: 100%;
}

.controls>.window-button {
    filter: brightness(0.8);
    aspect-ratio: 1.5;
    display: flex;
    justify-content: center;
}

.controls>.window-button:hover {
    filter: none;
    background-color: #fff2;
}

.controls>.window-button:last-child:hover {
    background-color: #e81123;
}

.window>.window-content-container {
    overflow: hidden;
    height: 100%;
    width: 100%;
    border: 1px solid var(--theme);
    background-color: var(--theme);
    box-shadow: 0 0 10px #0008;
}

.window>.window-content-container>.container {
    height: calc(100% - var(--controls-height));
    width: 100%;
    top: var(--controls-height);
    position: relative;
    display: block;
}

.window>.window-content-container>.container>iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    border: none;
    user-select: none;
}

iframe.disabled {
    pointer-events: none;
}